//将一些公共的部分写到这里，减少了代码的冗余
$(document).ajaxSend(function (e, xhr, opt) {
    var user_token = localStorage.getItem("user_token");
    xhr.setRequestHeader("user_token_header", user_token);
});

function getUserInfo(url) {
    $.ajax({
        type:"get",
        url:url,
        success: function(result) {
            if(result.code==200 && result.data!=null) {
                $(".left .card h3").text(result.data.userName);
                //这里是对a这个标签里面的属性进行赋值
                $(".left .card a").attr("href", result.data.githubUrl);
            }
        }
    });
}
function logout() {
    localStorage.removeItem("user_token");
    location.href="blog_login.html"
}